<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>ServletAPI内置对象</title>
</head>
<body>
<div>
<!--    获取域的属性值-->
    <span th:text="${#request.getAttribute('req')}"></span><br>
    <span th:text="${#session.getAttribute('ses')}"></span><br>
    <span th:text="${#servletContext.getAttribute('app')}"></span><br>
    <hr>
<!--    获取上下文路径-->
    <span th:text="${#request.getContextPath()}"></span><br>
<!--    获取请求参数-->
    <span th:text="${#request.getParameter('name')}"></span><br>

<!--定义页面-->
    <hr>
    <!--格式化日期-->
    <span th:text="${#dates.format(today,'yyyy-MM-dd')}"></span><br>
    <!--从身份证中截取出生日期-->
    <span th:text="${#strings.substring(cardId,2,5)}"></span><br>
    <!--对数组元素求和-->
    <span th:text="${#aggregates.sum(nums)}"></span><br>
</div>
</body>
</html>